package com.example.helpcenter2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.IntentFilter;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    private HelpReceiver helpReceiver;
    private SecondHelpReceiver secondHelpReceiver;
    private ThirdHelpReceiver thirdHelpReceiver;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        helpReceiver=new HelpReceiver();
        IntentFilter filter=new IntentFilter();
        filter.addAction("Help");
        filter.setPriority(1000);
        registerReceiver(helpReceiver,filter);
        secondHelpReceiver=new SecondHelpReceiver();
        IntentFilter secondFilter=new IntentFilter();
        secondFilter.addAction("Help");
        secondFilter.setPriority(1100);
        registerReceiver(secondHelpReceiver,secondFilter);
        thirdHelpReceiver=new ThirdHelpReceiver();
        IntentFilter thirdFilter=new IntentFilter();
        thirdFilter.addAction("Help");
        thirdFilter.setPriority(1200);
        registerReceiver(thirdHelpReceiver,thirdFilter);
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        unregisterReceiver(helpReceiver);
        unregisterReceiver(secondHelpReceiver);
        unregisterReceiver(thirdHelpReceiver);
    }


}
